package trefliq.persistence.entity;

import java.io.Serializable;
import javax.persistence.Embeddable;

/**
 *
 * @author Eric
 */

@Embeddable
public class ReviewPK implements Serializable {
    
    private Long movieid;
    private Long accountid;
    
    public ReviewPK() {
    }
    
    public Long getMovieid() {
        return movieid;
    }
    
    public void setMovieid(Long movieid) {
        this.movieid = movieid;
    }
    
    public Long getAccountid() {
        return accountid;
    }
    
    public void setAccountid(Long accountid) {
        this.accountid = accountid;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (movieid != null ? movieid.hashCode() : 0);
        hash += (accountid != null ? accountid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReviewPK)) {
            return false;
        }
        ReviewPK other = (ReviewPK) object;
        if ((this.movieid == null && other.movieid != null) || (this.movieid != null && !this.movieid.equals(other.movieid))) {
            return false;
        }
        
        if ((this.accountid == null && other.accountid != null) || (this.accountid != null && !this.accountid.equals(other.accountid))) {
            return false;
        }
        
        return true;
    }

    @Override
    public String toString() {
        return "trefliq.persistence.entity.ReviewPK[ accountid=" + accountid + " movieid=" + movieid +" ]";
    }
}
